class DictWrapper(dict):
    def __init__(self, dictionary):
        """
        DictWrapper类是我自己写的，用来包装字典，使得可以用点运算符来访问字典的key，可以将带有嵌套的字典包装成DictWrapper对象
        :param dictionary: dict 要包装的字典
        """
        super().__init__()
        self.update(dictionary)
        for key, value in dictionary.items():
            if isinstance(value, dict):
                self[key] = DictWrapper(value)

    def __getattr__(self, key):
        if key in self:
            return self[key]
        else:
            raise AttributeError(f"'DictWrapper' object has no attribute '{key}'")

    def __setattr__(self, key, value):
        self[key] = value


if __name__ == '__main__':
    a = {
        "a1": {
            "a11": 11
        }
    }
    a_ = DictWrapper(a)
    print(a_.a1.a11)
    a_.a1.a11 = 100
    print(a_.a1.a11)
